import { getStore } from "@/util/store";

// const dicData = (() => {
//   let list = [].map(ele => {
//     return {
//       label: ele,
//       value: ele
//     }
//   })
//   return list
// })()
const jgbh = (() => {
  let org = getStore({ name: "org" });
  console.log(org);
  return org.jgbh;
})();

export default that => {
  return {
    index: true,
    border: true,
    stripe: true,
    addBtn: false,
    editBtn: false,
    delBtn: false,
    submitBtn: false,
    emptyBtn: false,
    maxHeight: 400,
    menuWidth: 480,
    menu: true,
    indexLabel: "序号",
    align: "center",
    column: [
      {
        labelWidth: 150,
        label: "档案编号",
        size: "small",
        addDisplay: false,
        hide: true,
        prop: "id"
      },
      {
        label: "jktjid",
        size: "small",
        addDisplay: false,
        hide: true,
        prop: "jktjid"
      },
      {
        labelWidth: 150,
        label: "姓名",
        size: "small",
        prop: "name",
        search: true,
        rules: [
          {
            required: true,
            message: "请填写姓名"
          }
        ]
        //addDisplay: false
      },
      {
        width: 160,
        labelWidth: 150,
        label: "身份证号",
        size: "small",
        search: true,
        prop: "sfzhm",
        //addDisplay: false
        blur: () => {
          that.getObjByIdCard();
        },
        rules: [
          {
            required: true,
            message: "请填写身份证号"
          }
        ]
      },
      {
        labelWidth: 150,
        label: "年龄",
        size: "small",
        search: true,
        //addDisplay: false,
        prop: "age"
      },
      {
        labelWidth: 150,
        label: "档案编号",
        size: "small",
        search: true,
        prop: "dnbh"
      },
      {
        labelWidth: 150,
        label: "个人基本信息ID",
        size: "small",
        prop: "grjbxxid",
        hide: true, //是否隐藏
        addDisplay: false
      },

      {
        width: 140,
        labelWidth: 150,
        label: "村（居）委会名称",
        size: "small",
        prop: "cwhmc",
        addDisplay: false
      },
      {
        labelWidth: 150,
        label: "村（居）委会名称",
        size: "small",
        prop: "cwhmcid",
        type: "select",
        search: true,
        hide: true,
        dicUrl: `/ykdjgxxs/getvill/${jgbh}`
      },
      {
        labelWidth: 150,
        label: "现住址",
        prop: "jkdnxzz",
        clearable: true,
        hide: true,
        rules: []
      },
      {
        labelWidth: 150,
        label: "户籍地址",
        prop: "jkdnhjdz",
        clearable: true,
        hide: true,
        rules: []
      },
      {
        labelWidth: 150,
        label: "建档人",
        size: "small",
        prop: "jdr",
        hide: true
      },
      {
        labelWidth: 150,
        label: "条纹码",
        prop: "tmcode",
        clearable: true,
        search: true,
        addDisplay: false
      },
      {
        width: 140,
        labelWidth: 150,
        label: "乡镇（街道）名称",
        size: "small",
        prop: "xzjdmc"
      },

      {
        labelWidth: 150,
        label: "建档单位",
        size: "small",
        hide: true,
        prop: "jddw"
      },
      {
        labelWidth: 150,
        label: "责任医生",
        size: "small",
        hide: true,
        prop: "zeys"
      },
      {
        labelWidth: 150,
        label: "建档日期",
        hide: true,
        size: "small",
        valueFormat: "yyyy-MM-dd",
        format: "yyyy-MM-dd",
        prop: "jdrq",
        type: "date"
      },
      {
        label: "建档日期",
        prop: "searchTime",
        format: "yyyy-MM-dd",
        valueFormat: "yyyy-MM-dd",
        type: "daterange",
        search: true,
        addDisplay: false,
        editDisplay: false,
        hide: true
      },
      {
        labelWidth: 150,
        label: "是否上传",
        size: "small",
        prop: "uploadFlag",
        slot: true,
        addDisplay: false
      },
      {
        labelWidth: 150,
        label: "基本信息",
        size: "small",
        prop: "person",
        addDisplay: false
      },
      {
        labelWidth: 150,
        label: "体检信息",
        size: "small",
        prop: "healthExam",
        addDisplay: false
      },
      {
        labelWidth: 150,
        label: "老年人专档",
        size: "small",
        prop: "elderInfo",
        addDisplay: false
      },
      {
        labelWidth: 150,
        label: "中医健康指导",
        size: "small",
        prop: "cmgOperation",
        addDisplay: false
      },
      {
        labelWidth: 150,
        label: "自理能力评估",
        size: "small",
        prop: "elderSelfcareAbility",
        addDisplay: false
      },
      {
        labelWidth: 150,
        label: "中医药健康",
        size: "small",
        prop: "elderTcmHealth",
        addDisplay: false
      },
      {
        labelWidth: 150,
        label: "B超",
        size: "small",
        prop: "bcbz",
        slot: true,
        addDisplay: false
      },
      {
        labelWidth: 150,
        label: "身高体重",
        size: "small",
        prop: "sgtzbz",
        slot: true,
        addDisplay: false
      },
      {
        labelWidth: 150,
        label: "一体机",
        size: "small",
        prop: "ytjbz",
        slot: true,
        addDisplay: false
      },
      {
        labelWidth: 150,
        label: "血球",
        size: "small",
        prop: "xqbz",
        slot: true,
        addDisplay: false
      },
      {
        labelWidth: 150,
        label: "生化",
        size: "small",
        prop: "shbz",
        slot: true,
        addDisplay: false
      }
    ]
  };
};
